package com.weimei.conversionTreasure.viewModel;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.weimei.conversionTreasure.activity.JyDetailActivity;
import com.weimei.conversionTreasure.http.entity.BillBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class BillItemIVM extends ItemViewModel {
    public ObservableField<BillBean.DataDTO.DlistDTO.DealDataDTO> entity = new ObservableField<>();

    public BillItemIVM(@NonNull BaseViewModel viewModel, BillBean.DataDTO.DlistDTO.DealDataDTO dealDataDTO) {
        super(viewModel);
        entity.set(dealDataDTO);
    }

    public BindingCommand itemClick = new BindingCommand(() -> {
        Bundle bundle = new Bundle();
        bundle.putString("id",entity.get().getId());
        viewModel.startActivity(JyDetailActivity.class,bundle);
    });
}
